/*
*
==============================================================================
*  Name        : 
*  Part of     : Omen Game Engine
*  Description : 
*  Version     : 1.0
*
*  Copyright (c) 2013 Lauri Kortevaara.
* 
==============================================================================
*/

#pragma once

#include <IOmenMaterial.h>
#include "OmenTexture.h"

#include <vector>

namespace Omen
{
    class Material : public Omen::IMaterial
    { 
        #define GUID_OMEN_MATERIAL "51346C74-70D2-4DCF-A532-5AD29B4E9D31"

    public:
        OMEN_API virtual Omen_GUID classId() const { return OMEN_UUID(GUID_OMEN_MATERIAL); }    /// <summary>Defines the class ID</summary>
    public:
        Material();
        Material( const Material& other );
        virtual ~Material();
        
        OMEN_API virtual std::wstring    name() const;
        OMEN_API virtual std::wstring&   name();

        OMEN_API virtual Omen::Vector4d  ambientColor() const;
        OMEN_API virtual Omen::Vector4d& ambientColor();
        
        OMEN_API virtual Omen::Vector4d  diffuseColor() const;
        OMEN_API virtual Omen::Vector4d& diffuseColor();

        OMEN_API virtual Omen::Vector4d  specularColor() const;
        OMEN_API virtual Omen::Vector4d& specularColor();

        OMEN_API virtual Omen::Float     shininess() const;
        OMEN_API virtual Omen::Float&    shininess();

        OMEN_API virtual std::wstring    textureFilename() const;
        OMEN_API virtual std::wstring&   textureFilename();

        // Texture maps
        OMEN_API virtual unsigned int    numTextures() const;
        OMEN_API virtual std::unique_ptr<Omen::ITexture>& texture( unsigned int iTexture );
        OMEN_API virtual void setTexture( unsigned int iTexture, std::unique_ptr<Omen::ITexture> texture );
        OMEN_API virtual void addTexture( std::unique_ptr<Omen::ITexture> texture );

        OMEN_API virtual bool operator ==( const std::wstring ) const;
        OMEN_API Omen::Material& operator=( const Material& other );
    protected:
    private:
        std::wstring                m_name;
        std::wstring                m_textureFilename;
        std::unique_ptr<Omen::ITexture> m_texture;
        //std::vector< std::unique_ptr<Omen::ITexture> >  m_textures;

        Omen::Vector4d              m_ambient, m_diffuse, m_specular;
        Omen::Float                 m_shininess;
    };
}